package tcm.com.gistone.database.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import tcm.com.gistone.database.entity.WordsRelation;

import java.util.List;

public interface WordsRelationMapper {
    int deleteByPrimaryKey(Long id);

    int insert(WordsRelation record);

    int insertSelective(WordsRelation record);

    WordsRelation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(WordsRelation record);

    int updateByPrimaryKey(WordsRelation record);


    int insertBatch(List<WordsRelation> list);

    @Select("select * from tb_words_relation where  word_id =#{wordId1} and ano_word_id = #{wordId2}  and book_id = #{bookId} and  sec_type = #{sec_type}")
    @ResultMap("tcm.com.gistone.database.mapper.WordsRelationMapper.BaseResultMap")
    WordsRelation selectOne(@Param("bookId") long bookId, @Param("wordId1") long  wordId1, @Param("wordId2") long  wordId2, @Param("sec_type") String sec_type);
}